
using DataAccess;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace KhoaLuan.MainSys.Manager.Controls
{
    public partial class ctManagementTypeOrg : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["folder"] = ""; show_tbOrgType(); } }
        tbOrgType_Proxy pr = new tbOrgType_Proxy();
        void show_tbOrgType()
        {
            List<tbOrgType> dt = new List<tbOrgType>();
            dt = pr.SelectAlltbOrgType_Proxy();

            dt.Clear();
            dt = null;
        }
        //protected void grd_showtbOrgType_PageIndexChanged(object source, DataGridPageChangedEventArgs e){
        // grd_showtbOrgType.CurrentPageIndex = e.NewPageIndex;
        // show_tbOrgType();}
        // protected void grd_showtbOrgType_ItemCommand(object source, DataGridCommandEventArgs e){
        // grd_showtbOrgType.EditItemIndex = (int)e.Item.ItemIndex;int a=grd_showtbOrgType.EditItemIndex;
        // this.txtId.Text = e.CommandArgument.ToString();
        // switch (e.CommandName.Trim().ToString()){
        // case "Edit":
        //{
        // List<tbOrgType> dt = new List<tbOrgType> ();
        // dt = pr.SelectAlltbOrgType_Proxy();
        // if (dt.Count > 0){
        //this.txtTypeOrgID.Text = dt[a].TypeOrgID.ToString(); 
        //this.txtNameTypeOrg.Text = dt[a].NameTypeOrg.ToString(); }
        // break;
        // case "Delete":
        // {
        // DataTable dt = new DataTable();
        // dt = pr.SelectAll_tbOrgType_Proxy();
        // int vt = 0;
        // vt = grd_showtbOrgType.EditItemIndex;
        // this.txtTypeOrgID.Text = dt.Rows[vt]["Id"].ToString();
        // pr.Delete_tbOrgType_Proxy(int.Parse(this.txtTypeOrgID.Text.ToString()));
        // show_tbOrgType(); 
        //}
        // break;
        // default:
        //break;
        // }}protected void lbtinserttbOrgType_Click(object sender, EventArgs e){
        //this.txtTypeOrgID.Text = "";
        //this.txtNameTypeOrg.Text = "";
        //}protected void LinkButton1_Click(object sender, EventArgs e)
        // {
        //this.pn_showtbOrgType.Visible = true;
        //this.pn_updatetbOrgType.Visible = false;
        //}
        //protected void btnThem_Click(object sender, EventArgs e)
        //{
        //this.pn_showtbOrgType.Visible = false;
        //this.pn_updatetbOrgType.Visible = true;
        // }
        //protected void LinkButton2_Click(object sender, EventArgs e)
        // {
        //this.lblerror.Text = "";
        //if (this.txtNameTypeOrg.Text.Trim().Length < 1)
        //{
        //this.lblerror.Text = "NameTypeOrg không được trống";
        // return;
        //}
        //this.txtNameTypeOrg.Text = "";
        //if (this.txtNameTypeOrg.Text.Trim().Length < 1)
        // {

        //tbOrgType	 a = new 	tbOrgType();
        // a.NameTypeOrg=this.txtNameTypeOrg.Text.Trim();
        // pr.Insert_tbOrgType_Proxy(a);
        // }
        //else
        // {

        //tbOrgType	 b = new 	tbOrgType();
        // b.TypeOrgID=int.Parse(this.txtTypeOrgID.Text.Trim());
        // b.NameTypeOrg= this.txtNameTypeOrg.Text.Trim();pr.Update_tbOrgType_Proxy(b); 
        //}
        //show_tbOrgType();
        //this.pn_updatetbOrgType.Visible = false;
        //this.pn_showtbOrgType.Visible = true;
        //this.txtNameTypeOrg.Text = "";
        // } 
    }

}